<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="layout :: head(~{ :: title}, ~{ :: link}, ~{ ::script},~{::style})">
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <title>商户管理平台</title>
    <style></style>
    <link rel="stylesheet" th:href="@{/plugins/jquery-treegrid/css/jquery.treegrid.css}"/>
    <link rel="stylesheet" th:href="@{/plugins/zTree_v3-master/css/zTreeStyle/zTreeStyle.css}">
    <script th:src="@{/plugins/jquery-treegrid/js/jquery.treegrid.js}"></script>
    <script th:src="@{/plugins/jquery-treegrid/js/jquery.treegrid.bootstrap3.js}"></script>
    <script th:src="@{/plugins/zTree_v3-master/js/jquery.ztree.core.js}"></script>
    <script th:src="@{/plugins/zTree_v3-master/js/jquery.ztree.excheck.js}"></script>
    <script th:inline="javascript">
        $(function(){
            $("#table").treegrid();
        });
    </script>
</head>
<body th:replace="layout::body(~{this::section})">
<section class="content-wrapper">
    <section class="content-header">
        <h1>
            机构
            <small>管理</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="/"><i class="fa fa-dashboard"></i> 商户管理平台</a></li>
            <li class="active">机构管理</li>
        </ol>
    </section>
    <section class="content">
        <div th:if="${respMsg != ''}" class="alert alert-danger alert-dismissible">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
            <h4><i class="icon fa fa-ban"></i> 操作提示</h4>
            <label th:text="${respMsg}"/>
        </div>
        <div class="row">
            <div th:each="opts:${session.WEBOPTS}" >
                <div  class="col-md-1"  th:if="${opts.href == '/MpsOrg/Save'}">
                    <a th:href="@{/MpsOrg/goMpsOrgAdd}" class="btn btn-primary">增加</a>
                </div>
            </div>
        </div>
        <table id="table" class="table tree">
            <thead>
            <tr>
                <th style="text-align: center">机构名称</th>
                <th style="text-align: center">备注</th>
                <th style="text-align: center">机构排序</th>
                <th style="text-align: center">机构状态</th>
                <th style="text-align: center">创建时间</th>
                <th style="text-align: center">修改时间</th>
                <th style="text-align: center">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="item:${MpsOrgList}" style="text-align: center">
                <td th:text="${item.name}"></td>
                <td th:text="${item.descr}"></td>
                <td th:text="${item.sort}"></td>
                <td th:text="${item.status}"></td>
                <td th:text="${item.createTime}"></td>
                <td th:text="${item.modifyTime}"></td>
                <td>
                    <span th:each="opts:${session.WEBOPTS}">
                         <span th:if="${opts.href == '/MpsOrg/Delete'}">
                            <a th:href="@{/MpsOrg/Delete(id=${item.id})}"
                               onclick="return confirm('确定删除?');">删除</a>
                        </span>
                        <span th:if="${opts.href == '/MpsOrg/Update'}">
                            <a th:href="@{/MpsOrg/goMpsOrgEdit(id=${item.id})}">修改</a>
                        </span>
                    </span>
                </td>
            </tr>
            </tbody>
        </table>
    </section>
</section>
</body>
</html>